<?php
    $link = mysqli_connect ("localhost","root","root","project");
    $sql = "SELECT * FROM ma";
    $res = mysqli_query($link,$sql);
    if($res){
        $msg = array();
        while($data = mysqli_fetch_assoc($res)){
            array_push($msg,$data);
        }
        $type = array("code"=>1,"point"=>$msg);
        echo json_encode($type);
    }else{
        $type = array("code"=>2,"point"=>$res);
        echo json_encode($type);
    }
?>